package com.itheima.mapper;

import com.itheima.pojo.Branch;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface PetBranchMapper {

    //添加门店
    @Insert("insert into petmn.pet_home (Branch_Name,Address) values (#{branchName},#{address})")
    void saveBranch(Branch branch);

    //删除门店
    @Delete("delete from petmn.pet_home where Branch_ID=#{id}")
    void deleteBranch(Integer id);

    //修改门店
    void updateBranch(Branch branch);

    //查询门店(根据ID查询)
    @Select("select * from petmn.pet_home where Branch_ID=#{id}")
    Branch getById(Integer id);

    //门店列表查询
    List<Branch> queryBranch();

    List<Map<String, Object>> countStoreData();
}
